SYSTEM Statement ---------------------------------------------------------------------------- Action Closes all open files and returns control to the operating system. Syntax SYSTEM n% Remarks The SYSTEM statement returns control to the operating system and returns the value n% to the operating system. The value n% can be used by DOS or OS-2 batch files or by non-BASIC programs. If n% is omitted, the SYSTEM statement returns a value of 0. Untrapped errors and fatal errors set the value of n% to -1. In a stand-alone program, SYSTEM returns to the operating system and closes all files; in the QBX environment, SYSTEM stops program execution and closes all files. Note A program containing a SYSTEM statement exits to the operating system if run from the QBX command line with the -RUN option. Entering a SYSTEM statement in the Immediate window terminates BASIC. BASICA END and SYSTEM are distinct in BASICA, but act identically in the current version of BASIC. See Also END, STOP Example See the ON ERROR statement programming example, which uses the SYSTEM statement.